package com.feixiang.springbootinit.model.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
/**
 * 会话存档消息动作枚举
 */
public enum SessionArchiveMsgActionEnum {

    SEND("send", "发送消息"),

    RECALL("recall", "撤回消息"),

    SWITCH("switch", "切换企业日志"),
    ;

    private String code;

    private String msg;


    public static String getNameByCode(String code) {
        SessionArchiveMsgActionEnum[] enums = SessionArchiveMsgActionEnum.values();
        for (int i = 0; i < enums.length; i++) {
            SessionArchiveMsgActionEnum anEnum = enums[i];
            if (anEnum.getCode().equalsIgnoreCase(code)) {
                return anEnum.getMsg();
            }
        }
        return null;
    }
}